package com.magicmovie.api.service;

import com.magicmovie.api.service.impl.MovieServiceImpl;
import com.magicmovie.entity.Movie;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "service",fallback = MovieServiceImpl.class)
public interface MovieService {

    @RequestMapping(value = "/movie/findByIndexCategoty",method = RequestMethod.GET)
    List<Map<String,Object>> findByIndexCategoty(@RequestParam("indexCategoryId") Integer indexCategoryId);

    @RequestMapping(value = "/movie/findById",method = RequestMethod.GET)
    Map<String,Object> findById(@RequestParam("id") Integer id);

    @RequestMapping(value = "/movie/findPurchasedMovie",method = RequestMethod.GET)
    Map<String, Object> findPurchasedMovie(@RequestParam("customerId") Integer customerId, @RequestParam("pageNum")Integer pageNum, @RequestParam("pageSize") Integer pageSize );

    @RequestMapping(value = "/movie/findByParams",method = RequestMethod.POST)
    Map<String,Object> findByParams(@RequestBody Map<String, Object> params,@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize);

    @RequestMapping(value = "/movie/findByHotSale",method = RequestMethod.GET)
    Map<String,Object> findByHotSale(@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize") Integer pageSize);

    @GetMapping("/movie/selectByPrimaryKey")
    Movie selectByPrimaryKey(@RequestParam("id") Integer id);
}
